<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="">
<meta name="author" content="ThemeBucket">
<link rel="shortcut icon" href="#" type="../image/png">
<title>Demo</title>
<!--data table-->
<link rel="stylesheet" href="../js/data-tables/DT_bootstrap.css" />
</head>
<body class="sticky-header"
	onload="indexmenu('${oneMenu}','${twoMenu}');">
	<%@ include file="../index/index.jsp"%>
	<section>
		<div class="main-content">
			<!-- 地址栏-->
			<div class="page-heading">
				<h3>后台管理系统</h3>
				<ul class="breadcrumb">
					<li><a href="#">会员管理管理</a></li>
					<li class="active">顾客管理</li>
				</ul>
			</div>
			<!--这里是写一些内容的  -->
			<div class="row">
				<div class="col-sm-12">
					<section class="panel">
						<div class="panel-body">
							<div class="adv-table">
								<div id="dynamic-table_wrapper"
									class="dataTables_wrapper form-inline" role="grid">
									<div class="span6">
										<div class="dataTables_filter" id="dynamic-table_filter">
											<input type="text" class="form-control" placeholder="搜索顾客"
												aria-controls="dynamic-table" id="search">
											<button class="btn btn-default" type="button"
												onclick="searchCustomer(1)">搜索</button>
										</div>
									</div>
								</div>
								<!--表格开始  -->
								<table
									class="display table table-bordered table-striped dataTable table-hover"
									id="dynamic-table" aria-describedby="dynamic-table_info">
									<thead>
										<tr role="row">
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">顾客id</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">顾客昵称</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">顾客头像</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">顾客手机号</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">推荐人手机号</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">钱包</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">类型</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending"
												onclick="jiangxu(1)">注册时间</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">状态</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">地区</th>
											<th class="sorting" role="columnheader" tabindex="0"
												aria-controls="dynamic-table" rowspan="1" colspan="1"
												aria-label="Rendering engine: activate to sort column ascending">编辑</th>
										</tr>
									</thead>
									<tbody role="alert" aria-live="polite" aria-relevant="all">
										<c:forEach var="customer" items="${customers}">
											<tr class="gradeA even">
												<td class="">${customer.customerId}</td>
												<td class="">${customer.nickName}</td>
												<td class=""><img alt=""
													src="http://oeilufnx2.bkt.clouddn.com/${customer.headImg}?imageView2/1/w/60/h/60"></td>
												<td class="">${customer.phone}</td>
												<td class="">${customer.referrer}</td>
												<td class="">${customer.wallet}</td>
												<c:choose>
													<c:when test="${customer.phone==null}">
														<td class="">经销商子账号</td>
													</c:when>
													<c:when test="${customer.phone!=null}">
														<td class="">普通顾客</td>
													</c:when>
												</c:choose>
												<td class=""><fmt:formatDate
														value="${customer.join_date }"
														pattern="YYYY/MM/dd HH:MM:SS" /></td>
												<c:if test="${customer.isDisable==0}">
													<td class="">正常</td>
												</c:if>
												<c:if test="${customer.isDisable==1}">
													<td class="">停用</td>
												</c:if>
												<c:if test="${customer.isDisable==2}">
													<td class="">未激活</td>
												</c:if>
												<td class="">${customer.region}</td>
												<td class=""><c:if test="${customer.isDisable==1}">
														<button class="btn btn-danger" type="button"
															disabled="disabled">停用</button>
													</c:if> <c:if test="${customer.isDisable!=1}">
														<button class="btn btn-danger" type="button"
															onclick="toUpdatecustomer(${customer.customerId})">停用</button>
													</c:if></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
								<!-- 表格结束 -->
								<!-- 分页开始 -->
								<div class="row-fluid">
									<div class="span6">
										<div class="dataTables_paginate paging_bootstrap pagination">
											<ul>
												<c:choose>
													<c:when test="${page.currentPage==1}">
														<li class="prev"><a class="page-link">← 上一页</a></li>
													</c:when>
													<c:otherwise>
														<li class="prev"><a
															href="../member/customer.do?currentPage=${page.currentPage-1}"
															class="page-link">← 上一页</a></li>
													</c:otherwise>
												</c:choose>
												<c:forEach begin="1" end="${page.totalPage}" var="p">
													<c:choose>
														<c:when test="${page.currentPage==p}">
															<c:if test="${p==1}">
																<li class="active page-item"><a class="page-link"
																	href="../member/customer.do?currentPage=${p}"
																	class="page-link">${p}</a></li>
																<c:if test="${page.totalPage>1}">
																	<li class="page-item"><a class="page-link"
																		href="../member/customer.do?currentPage=${p+1}">${p+1}</a></li>
																</c:if>
																<c:if test="${page.totalPage>2}">
																	<li class="page-item"><a class="page-link"
																		href="../member/customer.do?currentPage=${p+2}">${p+2}</a></li>
																</c:if>
																<c:if test="${page.totalPage>3}">
																	<li class="page-item"><a class="page-link"
																		href="#">...</a></li>
																</c:if>
															</c:if>
															<c:if test="${p>1}">
																<c:if test="${p<page.totalPage}">
																	<c:if test="${p>2}">
																		<li class="page-item"><a class="page-link"
																			href="#">...</a></li>
																	</c:if>
																	<li class="page-item"><a class="page-link"
																		href="../member/customer.do?currentPage=${p-1}">${p-1}</a></li>
																	<li class="active page-item"><a class="page-link"
																		href="../member/customer.do?currentPage=${p}"
																		class="current_page">${p}</a></li>
																	<c:if test="${page.totalPage>2}">
																		<li class="page-item"><a class="page-link"
																			href="../member/customer.do?currentPage=${p+1}">${p+1}</a></li>
																	</c:if>
																	<c:if test="${page.totalPage-p>1}">
																		<li class="page-item"><a class="page-link"
																			href="#">...</a></li>
																	</c:if>
																</c:if>
																<c:if test="${p==page.totalPage}">
																	<c:if test="${p>3}">
																		<li class="page-item"><a class="page-link"
																			href="#">...</a></li>
																	</c:if>
																	<c:if test="${p>2}">
																		<li class="page-item"><a class="page-link"
																			href="../member/customer.do?currentPage=${p-2}">${p-2}</a></li>
																	</c:if>
																	<li class="page-item"><a class="page-link"
																		href="../member/customer.do?currentPage=${p-1}">${p-1}</a></li>
																	<li class="active page-item"><a class="page-link"
																		href="../member/customer.do?currentPage=${p}"
																		class="current_page">${p}</a></li>
																</c:if>
															</c:if>
														</c:when>
													</c:choose>
												</c:forEach>

												<c:choose>
													<c:when test="${page.currentPage==page.totalPage}">
														<li class="pre"><a class="page-link">下一页 → </a></li>
													</c:when>
													<c:otherwise>
														<li class="pre"><a
															href="../member/customer.do?currentPage=${page.currentPage+1}"
															class="page-link">← 下一页</a></li>
													</c:otherwise>
												</c:choose>
												<li class="page-item"><a class="page-link">总共${page.totalPage}页</a></li>
											</ul>
										</div>
									</div>
								</div>
								<!-- 分页结束 -->
							</div>
						</div>
					</section>
				</div>
			</div>

		</div>
	</section>


</body>
<script src="../js/member/member.js"></script>
</html>
